/**
 * Created with  SublimeText
 * @Author:      Lyle
 * @DateTime:    2017-10-20 16:59:59
 * @Description: 
 */
import './global'
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import Routers from './router/router';

import './index.css';

import { IntlProvider, addLocaleData } from 'react-intl';
import en from 'react-intl/locale-data/en';
import zh from 'react-intl/locale-data/zh';
import zhCN from './i18n/zh.js';
import enUS from './i18n/en.js';

import registerServiceWorker from './registerServiceWorker';

addLocaleData([...en, ...zh]);

const lang = 'en'; //en or zh 
const messages = lang === 'en' ? enUS : zhCN;

class App extends Component {
    render() {
        return (
            <IntlProvider locale={'en'} messages={ messages }>         
                <Routers></Routers>
            </IntlProvider>
        )
    }
};

ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();